﻿using System;
using System.Windows.Forms;

namespace GUI
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CurrentCulture;
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CurrentUICulture;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                WinAPI.DriverLoader.LoadDriver();
                Application.Run(new MainForm());
            }
            catch (Exception)
            {
                MessageBox.Show("The problem was occured and application is unexpectedly closed. Try to reboot your machine", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            // try { }
            finally
            {
                WinAPI.DriverLoader.UnloadDriver();
            }
        }
    }
}
